var t = getApp();

Page({
    data: {
        infoData: [],
        dyFormPopup: !1,
        selfPay: !1,
        diyform: {
            form_id: "",
            diyform_data_id: "",
            pre_id: ""
        }
    },
    onLoad: function(t) {
        wx.setNavigationBarTitle({
            title: "确认订单"
        }), this.data.options = t, "true" == t.self && this.setData({
            selfPay: !0
        }), console.log(this.data.selfPay), this.getData();
    },
    dyFormPopupClick: function() {
        this.setData({
            dyFormPopup: !0
        });
    },
    showDiyClose: function() {
        this.setData({
            dyFormPopup: !1
        });
    },
    traCheckedData: function(t) {
        this.setData({
            dyFormPopup: !1,
            "diyform.diyform_data_id": t.detail.diyform_data_id
        });
    },
    getData: function() {
        var i = this, a = t.getNetAddresss("plugin.crowdfunding.frontend.pre-activity-order.selfPaidPreOrder");
        t._getNetWork({
            url: a,
            data: {
                activity_id: this.data.options.id
            },
            success: function(a) {
                var o = a.data;
                1 == o.result ? i.setData({
                    infoData: o.data,
                    "diyform.form_id": o.data.diy_form_id
                }) : t.tips(o.msg);
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    submitTap: function() {
        var i = this, a = "";
        if (this.data.diyform.diyform_data_id) {
            var o = {
                diy_form_data_id: this.data.diyform.diyform_data_id,
                activity_id: this.data.infoData.id
            };
            this.data.options.uid && (o.uid = this.data.options.uid), this.data.selfPay ? (o.diy_form_id = this.data.infoData.diy_form_id, 
            a = t.getNetAddresss("plugin.crowdfunding.frontend.pre-activity-order.joinSelfPaidActivity")) : a = t.getNetAddresss("plugin.crowdfunding.frontend.activity-member.joinCrowdfundingActivity"), 
            t._getNetWork({
                url: a,
                data: o,
                success: function(a) {
                    var o = a.data;
                    1 == o.result ? i.data.selfPay ? wx.navigateTo({
                        url: "/packageF/crowd_activity/crowd_activity_OrderPay/crowd_activity_OrderPay?sn=" + o.data.order_sn
                    }) : wx.showToast({
                        title: o.msg,
                        duration: 1e3,
                        icon: "none",
                        success: function(t) {
                            setTimeout(function() {
                                wx.navigateTo({
                                    url: "/packageF/crowd_activity/funding/funding?id=" + o.data.activity_member_id
                                });
                            }, 1e3);
                        }
                    }) : t.tips(o.msg);
                },
                fail: function(t) {
                    console.log(t);
                }
            });
        } else t.tips("请填写表单");
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});